package com.wyhello.tube4.spring.model;

import java.util.List;

import com.wyhello.tube4.facade.TubeFacade;
import com.wyhello.tube4.pojo.Macroscopic;
import com.wyhello.tube4.pojo.Reality;
import com.wyhello.tube4.pojo.Reside;

public class MeterRecordsModel {

	private TubeFacade facade;

	public TubeFacade getFacade() {
		return facade;
	}

	public void setFacade(TubeFacade facade) {
		this.facade = facade;
	}
	
	//实际测量模块
	/**
	 * 保存实际测量记录
	 * @param reality
	 * @return
	 */
	public boolean saveReality(Reality reality){
		return facade.saveReality(reality);
	}
	
	/**
	 * 对实际测量记录进行修改
	 * @param reality
	 * @return
	 */
	public boolean updateReality(Reality reality){
		return facade.updateReality(reality);
	}
	/**
	 * 删除实际测量记录
	 * @return
	 */
	public int deleteReality(String ids){
		return facade.deleteReality(ids);
	}
	/**
	 * 查询实际测量记录
	 * @return
	 */
	public List<Reality> queryReality(int offset){
		return facade.queryReality(offset);
	}
	public List<Reality> queryReaTime(int offset,String begin,String end){
		return facade.queryRealTime(offset, begin, end);
	}
	/**
	 * 查询指定位置下实测记录的最大ID值
	 * @param positionId 
	 * @return 
	 */
	public int queryRealityMaxId(int positionId){
		return facade.queryRealityMaxId(positionId);
	}
	/**
	 * 根据id查询实际测量信息
	 * @param id 要查询的id
	 * @return 为ID的实际测量信息
	 */
	public Reality getRealityById(int id) {
		return facade.getRealityById(id);
	}
	
	//公共方法
	/**
	 * 添加实际测量记录前查询锅炉信息
	 * 查询锅炉的信息
	 * @return
	 */
	public List<Reside> queryResideByBoiler(){
		return facade.queryResideByBoiler();
	}
	/**
	 * 根据级别查询信息
	 * @param reside
	 * @return
	 */
	public List<Reside> queryResideByLevel(int level){
		return facade.queryResideByLevel(level);
	}
	
	//宏观测量模块
	/**
	 * 
	 * @param macroscopic
	 * @return
	 */
	public boolean saveMacroscopic(Macroscopic macroscopic){
		return facade.saveMacroscopic(macroscopic);
	}
	/**
	 * 批量删除宏观测量
	 * @param ids
	 * @return
	 */
	public int deleteMacroscopic(String ids){
		return facade.deleteMacroscopic(ids);
	}
	/**
	 * 修改宏观测量信息
	 * @param macroscopic
	 * @return
	 */
	public boolean updateMacroscopic(Macroscopic macroscopic){
		return facade.updateMacroscopic(macroscopic);
	}
	/**
	 * 根据ID查询宏观测量信息
	 * @param id
	 * @return
	 */
	public Macroscopic getrMacroscopic(int id){
		return facade.getMacroscopicById(id);
	}
	/**
	 * 查询宏观测量信息
	 * @return
	 */
	public List<Macroscopic> queryMacroscopic(int offset){
		return facade.queryMacroscopic(offset);
	}

	public List<Macroscopic> queryMacTime(int offset,String begin,String end){
		return facade.queryMacTime(offset, begin, end);
	}
	
	/**
	 * 查询宏观记录数量
	 * @return
	 */
	public int queryCountMacroscopic(){
		return facade.queryCountMacroscopic();
	}
	
	/**
	 * 查询实测记录数量
	 * @return
	 */
	public int queryCountReality(){
		return facade.queryCountReality();
	}
	public int queryCountMacTime(String begin,String end){
		return facade.queryCountMacTime(begin, end);
	}
	public int queryCountReaTime(String begin, String end){
		return facade.queryCountReaTime(begin, end);
	}
	/**
	 * 指定位置ID时间限制查询检查信息
	 * @param positionId
	 * @param begin
	 * @param end
	 * @return
	 */
	public List<Macroscopic> queryMacroscopicTime(int positionId, String begin,
			String end){
		return facade.queryMacroscopicTime(positionId, begin, end);
	}
}
